VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "clsRASError"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'*---------------------------------------------------------------
'*
'* ClassName:      clsRASError
'* FileName:       RASERROR.CLS
'* Date:           July 1998
'* Author:         Ian M. Weatherburn
'* Company:        Mindkey Software Solutions (Pty) Ltd.
'* Copyright:      Copyright (C) 1998 by Mindkey Software Solutions
'*                 All Rights Reserved
'* Description:    Remote Access Server Error Handling
'*
'*---------------------------------------------------------------

Option Explicit

Public Sub Clear()
  lngRASErrorNumber = 0
  strRASErrorMessage = ""
End Sub

Public Property Get Message() As String
  Message = strRASErrorMessage
End Property

Public Property Get ErrorNumber() As Long
  ErrorNumber = lngRASErrorNumber
End Property

Public Function fnRASErrorMessage() As String
  Dim lngRetCode As Long
  ' Error string buffer. 256 bytes is enough for all errors
  Dim strRASErrorString As String
  
  ' Fill String
  strRASErrorString = Space$(256)
  
  
  ' lngRASErrorNumber is the RAS error number in the class
  Select Case lngRASErrorNumber
    Case Is >= 600
      lngRetCode = RasGetErrorString(lngRASErrorNumber, strRASErrorString, 256&)
      If lngRetCode Then
        fnRASErrorMessage = "Call to RASGetErrorString Failed. Error Retrieving message!"
      Else
        fnRASErrorMessage = strRASErrorString
      End If
    Case NOT_SUPPORTED
      fnRASErrorMessage = "Function is not supported on this version of Windows"
    Case Else
      fnRASErrorMessage = "Unexpected Error. See WIN32 SDK for more information"
  End Select

End Function

'*---------------------------------------------------------------
'* EOF: clsRASError
'*---------------------------------------------------------------
